package com.sd365.permission.centre.service;


import com.sd365.permission.centre.entity.Department;
import com.sd365.permission.centre.entity.Position;
import com.sd365.permission.centre.entity.Role;
import com.sd365.permission.centre.entity.User;
import com.sd365.permission.centre.pojo.dto.UserDTO;
import com.sd365.permission.centre.pojo.dto.pcp.PcpUserDTO;
import com.sd365.permission.centre.pojo.dto.shop.ShopBuyerDTO;
import com.sd365.permission.centre.pojo.query.UserQuery;

import com.sd365.permission.centre.pojo.vo.UserVO;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;
import java.util.List;

/**
 * @author yangshaoqi
 * @version 1.0.0
 * @class UserService
 * @classdesc 维护用户信息的服务接口
 * @date 2020-12-14  21点28分
 * @see
 * @since
 */
public interface UserService {

    byte INITIALIZE_STATUS_VALUE=1;
    long INITIALIZE_VERSION_VALUE=1;

    /**
     * @param: 商品DTO
     * @return: 成功则true
     * @see
     * @since
     */
    @Transactional
    Boolean add(@RequestBody @Valid UserDTO userDTO);


    /**
     * @param: id与版本
     * @return: 成功则true
     * @see
     * @since
     */
    @Transactional
    Boolean remove(Long id, Long version);


    /**
     * @param: 商品DTO
     * @return: 成功则true
     * @see
     * @since
     */
    @Transactional
    Boolean modify(UserDTO userDTO);

    /**
     * @param: 商品DTO
     * @return: 成功则true
     * @see
     * @since
     */
    @Transactional
    Boolean modifyWithNewRole(UserDTO[] userDTOS);

    /**
     * @param: 用户搜索条件
     * @return: 用户角色列表
     * @see
     * @since
     */

    List<UserVO> commonQuery(UserQuery userQuery);

    /**
     * @param: 用户id
     * @return: user
     * @see
     * @since
     */
    UserVO queryUserById(Long id);

    /**
     * @param:
     * @return:
     * @see
     * @since
     */
    List<Role> queryAllRole();
    /**
     * @param:
     * @return:
     * @see
     * @since
     */
    List<Department> queryAllDepartment();
    /**
     * @param:
     * @return:
     * @see
     * @since
     */
    List<Position> queryAllPosition();



    /**
     *  批量更新商品记录
     * @param userDTOS
     * @return
     */
    @Transactional
    Boolean batchUpdate(UserDTO[] userDTOS);


    /**
     * 批量删除商品记录
     * @param userDTOS
     * @return
     */
    @Transactional
    Boolean batchDelete(UserDTO[] userDTOS);


    Boolean firstStartMd5();


    Boolean updatePassword(UserDTO userDTO);

    /**
     * code 查询用户信息
     * @param code
     * @return
     */
    User getUser(String code );
}
